package com.abou.connector.dao;

/**
 * The generic DAO used to manage the entities.
 * 
 * @author ztrt8431
 * @param <T> The entity that is managed by the DAO
 */
public interface IGenericDao<T> {
  
  /**
   * Finds the object denoted by the passed ID.
   * 
   * @param id An object ID
   * @return The object for the ID.
   */
  T find(Object id);
  
  /**
   * Persists the passed object in the database.
   * 
   * @param object An object.
   */
  void create(Object object);
  
  /**
   * Deletes the object denoted by the passed ID from the database.
   * 
   * @param entity An entity
   */
  void delete(Object entity);
  
  /**
   * Merges the passed entity
   * 
   * @param entity An entity
   */
  void merge(Object entity);
}
